The present invention relates to the mixing of two signals, and more particularly to an improved digital video mixer that adds a correction term to provide full mixing range while satisfying all mixing constraints.
A mix between two signals, A and B, with the mix proportion controlled by a variable K is mathematically defined as: EQU MIX=A*K+B*(1.0-K)
where K is a variable having a range between 0.0 and 1.0 inclusive. Furthermore the mix result should meet the following constraints:
1) A*K+B*(1.0-K)=A where K=1.0 PA1 2) A*K+B*(1.0-K)=B where K=0.0 PA1 3) A*K+A*(1.0-K)=A for all K
In one prior art method of mixing employing a digital mixer control signal to represent the variable K, for the K variable 0.0 is defined as 0 and 1.0 is defined as 2 (n-1) where represents the exponentiation operator and n is the number of bits in the digital mixer control signal. Therefore when K =0, (1.0-K) =2 (n-1) and when K =2 (n-1), (1.0 -K) =0. K values in the range 2 (n-1) +1 to 2 n-1 are not valid. For eight-bit signals (n=8) 0.0 is 0.0000000 binary and 1.0 is 1.0000000 binary. K values in the range 1.0000001 to 1.1111111 binary are not valid. Thus approximately one-half of the available range of K is not valid. This implementation, as shown in FIG. 1, satisfies all of the constraints, but the loss of resolution due to the unused values of K results in coarser mix steps.
Another prior art method is shown in FIG. 2 where for the K input 0.0 is defined as 0 and 1.0 is defined as 2 n-1. When 1.0 is defined as 2 n-1, (1.0-K) is equivalent to K. Therefore when K =0, (1.0-K) =2 n-1 and when K =2 n-1, (1.0-K) =0. For eight-bit signals (n=8) 0.0 is .00000000 binary and 1.0 is .11111111 binary. This implementation uses all of the available K range, but the results do not satisfy all of the constraints. For example when A=11111111. binary, K=.11111111 binary and K=.00000000 binary, A*K+B* K should equal A. The B* K term equals zero, but the A*K term equals 11111111. * .11111111=11111110.00000001 which, when truncated to eight bits, becomes 11111110. rather than 11111111.
Thus what is desired is an improved digital mixer for mixing two signals according to a variable K that uses the full range of K while meeting all desirable mixer constraints.